import "./global.css";
import "./i18n";

import { Suspense, StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { Provider } from "react-redux";
import { RouterProvider, createBrowserRouter } from "react-router-dom";
import { Loading } from "@/components/loading";
import store from "@/store";
import routes from "@/routes";

createRoot(document.getElementById("root") as HTMLElement).render(
  <StrictMode>
    <Provider store={store}>
      <Suspense fallback={<Loading />}>
        <RouterProvider router={createBrowserRouter(routes)} fallbackElement={<p>Loading...</p>} />
      </Suspense>
    </Provider>
  </StrictMode>,
);
